// 用于适配iphoneX
var text = document.querySelectorAll('.index_text');
var windowWidth = document.body.clientWidth;
var windowHeight = document.body.clientHeight;

var times = setInterval(function(){
	if(windowHeight/windowWidth > 1.85){
		for(var i=0;i<text.length;i++){
			text[i].style.paddingBottom = '.6rem';
		}
	}
	clearInterval(times);
	for(var i=0;i<text.length;i++){
		text[i].style.display='block';
	}
},100);
(function(doc, win) {
    var docEl = doc.documentElement,
        resizeEvt = 'orientationchange' in window ? 'orientaitonchange' : 'resize',
        recalc = function () {
            var baseFontSize = 50; // ��Ԫ�ػ�׼�����С
            var designWidth  = 375; // ��Ƹ���
            var designHeight = 603; // ��Ƹ�߶�
            var maxWidth     = 375; // ��Ƹ������
            var maxHeight    = 603; // ��Ƹ����߶�
            var clientWidth  = docEl.clientWidth;
            var clientHeight = docEl.clientHeight;
            if (!clientWidth) return;
            if (clientWidth / clientHeight > designWidth / designHeight) {
                if (clientHeight <= maxHeight) {
                    docEl.style.fontSize = clientHeight / designHeight * baseFontSize + "px";
                } else {
                    docEl.style.fontSize = maxHeight / designHeight * baseFontSize + "px";
                }
            } else {
                if (clientWidth <= maxWidth) {
                    docEl.style.fontSize = clientWidth / designWidth * baseFontSize + "px";
                } else {
                    docEl.style.fontSize = maxWidth / designWidth * baseFontSize + "px";
                }
            }
        };

    // Abort if browser does not support addEventListener
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);